import vue from '@vitejs/plugin-vue2'
import vueJsx from '@vitejs/plugin-vue-jsx'
import path from 'node:path';

export default {
  plugins: [vue(), vueJsx()],

  build: {
    lib: {
      entry: path.resolve(__dirname, '../../packages/components/src/main.js'),
      name: 'MyLib',
      fileName: 'my-lib',
    },
    outDir: '../../packages/components/dist/v2.7',

    rollupOptions: {
      external: ['vue', 'vue-demi'],
    },
  },
  optimizeDeps: {
    exclude: ['vue-demi']
  }
}
